package task3;

import javax.annotation.processing.SupportedSourceVersion;
import sun.security.pkcs11.P11TlsKeyMaterialGenerator;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/8 8:57
 * @description:
 */
public class Demo {

  public static void main(String[] args) {
    Product p1=new Product();
    p1.setName("茶叶蛋");
    Product p2=new Product();
    p2.setName("酸奶");

  /*创建超市对象，让超市上述2个商品*/
  Market market = new Market();
  market.setName("十足");
  Product[] p = {p1,p2};
  market.setProducts(p);

  /*创建一个商品对象*/
  Product p3=new Product();
  p3.setName("作业");

  /*创建顾客对象，调用方法超市买商品*/
  Custom custom=new Custom();
  custom.setName("小王");
  custom.shopping(market,p1);
  custom.shopping(market,p3);
 }
}